package com.softeem.score.manager.mapper;

import com.softeem.score.model.dto.SysUserDto;
import com.softeem.score.model.entity.system.SysUser;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author zhu
 * @since 2024-02-14
 */
public interface SysUserMapper {

    List<SysUser> findByPage(SysUserDto sysUserDto);

    void updateSysUser(SysUser sysUser);

    void deleteById(Long userId);

    boolean existsUserWithRoleId(Long roleId);

    SysUser selectUserInfoByUserName(String userName);

    void saveSysUser(SysUser sysUser);

    void updateStatus(Long userId, Integer status);

    void bindingRoles(@Param("userId") Long userId, @Param("roleId") Long roleId);

    void updateAvatar(Long userId, String avatar);

    void deleteSysUserBySysUserName(String sysUserName);

    void updateMobile(String username, String mobile);

    void restartPassword(@Param("newPassword") String newPassword, @Param("username") String username);

    void updateIpconf(@Param("id") Long id, @Param("ipconf") String ipconf);

    Integer findByUsernameAndMobile(@Param("username") String username, @Param("mobile") String mobile);
}
